package com.xiaotao.controller;

import com.xiaotao.entity.Type;
import com.xiaotao.service.TypeService;
import com.xiaotao.util.ResponseUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("system")
public class TypeController {
    @Resource
    private TypeService typeService;


    @GetMapping
    public ResponseUtil findAll(){
        return typeService.findAll();
    }

    @PutMapping
    public ResponseUtil update(@RequestBody Type type){
        return typeService.update(type);
    }

    @DeleteMapping("{id}")
    public ResponseUtil delete(@PathVariable Integer id){
        return typeService.delete(id);
    }
}
